﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing;
using td.Core;

namespace td.Addin
{
    /// <summary>
    /// 插件配置命令，创建插件配置界面 
    /// </summary>
    public class SystemConfig:td.Core.AbstractToolButtonCommand
    {
        public override void Run()
        {
            if (WorkBenchSingleTon.WorkBench.GetTabPage("系统配置") == null)
            {
                TestView v = new TestView();
                WorkBenchSingleTon.WorkBench.AddView((AbstractViewContent)v);
                WorkBenchSingleTon.WorkBench.TabPageClosing += new EventHandler(WorkBench_TabPageClosing);
            }
        }

        void WorkBench_TabPageClosing(object sender, EventArgs e)
        {
            if (((IViewContent)sender).Title == "系统配置")
            {

            }
        }
        public override bool IsEnabled
        {
            get
            {
                return WorkBenchSingleTon.WorkBench.GetTabPage("系统配置") == null;
            }
            set
            {
                base.IsEnabled = value;
            }
        }
    }
}
